package com.allenkerr.domain;


import org.springframework.jdbc.core.RowMapper;

import java.sql.ResultSet;
import java.sql.SQLException;

/**
 * Created by 小柯(Allen Kerr) on 17.5.16 15:26.
 */
public class CustomerRowMapper implements RowMapper<Customer> {

    @Override
    public Customer mapRow(ResultSet rs, int rowNum) throws SQLException {
        Customer customer = new Customer();
        customer.setId(rs.getInt("id"));
        customer.setName(rs.getString("name"));
        customer.setStation(rs.getString("station"));
        customer.setTelephone(rs.getString("telephone"));
        customer.setAddress(rs.getString("address"));
        customer.setDecidedZoneId(rs.getString("decidedzone_id"));
        return customer;
    }
}
